<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/**
 * Init Model
 *
 */


class News_models extends CI_Model {
	
	function __construct(){
		parent::__construct();
	}

	
	function getNews($limit=5,$status=51){
		$sql = "select * from news where status=$status order by (id) desc limit 0,$limit";
		$result = $this->db->query($sql)->result();
		if($result){
			return $result;
		}else{
			return false;
		}
	}
	
	function get_news_info($id=0){
		$sql = "select * from news where id=$id";
		$row = $this->db->query($sql)->row();
		if($row){
			return $row;
		}else{
			return false;
		}
	}
	
	
}